#pragma once

#include "Strategy_CommonDefine.h"

template<class _Ty>
class CProperty
{
public:
  virtual double operator[](int _Pos) = 0;

  BAR_QUEUE::size_type size() const
  {	// return length of sequence
    return m_arr->size();
  }

public:
  _Ty* m_arr;
};

class CBarProperty : public CProperty<BAR_QUEUE>
{

};

class CTickProperty : public CProperty<CTP_MARKETDATA_QUEUE>
{

};

class COpen : public CBarProperty
{
public:
  double operator[](int _Pos)
  {	
    return (*m_arr)[_Pos]->open;
  }
};

class CHigh : public CBarProperty
{
public:
  double operator[](int _Pos)
  {	
    return (*m_arr)[_Pos]->high;
  }
};

class CLow : public CBarProperty
{
public:
  double operator[](int _Pos)
  {	
    return (*m_arr)[_Pos]->low;
  }
};

class CClose : public CBarProperty
{
public:
  double operator[](int _Pos)
  {	
    return (*m_arr)[_Pos]->close;
  }
};

class CNew : public CTickProperty
{
public:
  double operator[](int _Pos)
  {	
    return (*m_arr)[_Pos]->LastPrice;
  }
};


